<template>
  <div id="client">
    <p style="margin-left: 20px">
      客户：<el-input
        style="width: 200px; margin-left: 10px; margin-right: 20px"
        placeholder="请输入客户"
        v-model="input"
        clearable
      ></el-input>
      <el-button
        style="margin-left: -20px; margin-right: 10px"
        @click="dialogFormVisible = true"
        >...</el-button
      >
      &nbsp;&nbsp;&nbsp; 销售人员
      <el-select v-model="value" placeholder="销售人员" style="width: 100px">
        <el-option
          v-for="item in options"
          :key="item.value"
          :label="item.label"
          :value="item.value"
        >
        </el-option> </el-select
      >&nbsp;&nbsp;&nbsp;
      <span class="demonstration">单据日期：</span>
      <el-date-picker
        v-model="value3"
        type="datetime"
        placeholder="选择日期时间"
        default-time="12:00:00"
      >
      </el-date-picker
      >&nbsp;&nbsp;&nbsp; 地址
      <el-select v-model="value" placeholder="地址" style="width: 200px">
        <el-option
          v-for="item in options"
          :key="item.value"
          :label="item.label"
          :value="item.value"
        >
        </el-option> </el-select
      >&nbsp;&nbsp;&nbsp;
    </p>
    <el-divider></el-divider>
    <div style="margin-bottom: 20px; margin-right: 20px; float: right">
      <el-button>保存</el-button>&nbsp;&nbsp;&nbsp;
      <el-button type="primary">提交</el-button>&nbsp;&nbsp;&nbsp;
      <el-button type="success">审核</el-button>&nbsp;&nbsp;&nbsp;
      <el-button type="warning">反审核</el-button>&nbsp;&nbsp;&nbsp;
      <el-button type="primary">批量导入</el-button>&nbsp;&nbsp;&nbsp;
    </div>
    <div style="margin-top: 30px">
      <el-table
        height="250px"
        :data="tableData"
        border
        style="width: 100%; font-size: 13px"
      >
        <el-table-column
          fixed
          label="序号"
          type="index"
          width="80"
          :index="indexMethod"
        >
        </el-table-column>
        <el-table-column prop="date" label="商品" width="230">
          <el-input
            style="width: 120px; margin-left: 10px; margin-right: 20px"
            placeholder="请输入商品"
            v-model="input"
            clearable
          ></el-input>
          <el-button
            style="margin-left: -20px; margin-right: 10px; width: 50px"
            @click="dialogFormVisible = true"
            >...</el-button
          >
        </el-table-column>
        <el-table-column prop="type" label="商品类别" width="120">
        </el-table-column>
        <el-table-column prop="ti" label="商品条码" width="120">
        </el-table-column>
        <el-table-column prop="length" label="长（cm）" width="120">
        </el-table-column>
        <el-table-column prop="width" label="宽（cm）" width="120">
        </el-table-column>
        <el-table-column prop="height" label="高（cm）" width="120">
        </el-table-column>
        <el-table-column prop="tiji" label="体积（cm3）" width="120">
        </el-table-column>
        <el-table-column prop="weight" label="重量" width="120">
        </el-table-column>

        <el-table-column prop="num" label="基本数量" width="120">
        </el-table-column>
        <el-table-column prop="ck" label="仓库" width="120"> </el-table-column>
        <el-table-column prop="picture" label="商品图片" width="120">
        </el-table-column>
        <el-table-column prop="danwei" label="单位" width="120">
        </el-table-column>
        <el-table-column prop="text" label="备注" width="120">
        </el-table-column>
        <el-table-column label="操作" fixed width="100">
          <template slot-scope="scope">
            <el-button @click="handleClick(scope.row)" type="text" size="small"
              >查看</el-button
            >
            <el-button type="text" size="small">编辑</el-button>
          </template>
        </el-table-column>
      </el-table>
      <div style="width: 100%; background-color: blanchedalmond; height: 30px">
        <table style="width: 78.7%; height: 30px">
          <tr>
            <td style="width: 50%">合计：</td>
            <td style="width: 50%">123</td>
          </tr>
        </table>
      </div>
      <el-input
        type="textarea"
        :rows="2"
        placeholder="暂无备注信息"
        v-model="textarea"
        style="width: 100%; line-height: 20px"
      >
      </el-input>
      <p style="margin-top: 20px; margin-left: 20px">
        寄件地址：<el-input
          style="width: 200px; margin-left: 10px; margin-right: 20px"
          placeholder="请输入寄件地址"
          v-model="input"
          clearable
        ></el-input>
        <el-button
          style="margin-left: -20px; margin-right: 10px"
          @click="dialogFormVisible = true"
          >...</el-button
        >
        &nbsp;&nbsp; 收件地址：<el-input
          style="width: 200px; margin-left: 10px; margin-right: 20px"
          placeholder="请输入收件地址"
          v-model="input"
          clearable
        ></el-input>
        <el-button
          style="margin-left: -20px; margin-right: 10px"
          @click="dialogFormVisible = true"
          >...</el-button
        >&nbsp;&nbsp; 物流公司：
        <el-input
          style="width: 200px; margin-left: 10px; margin-right: 20px"
          placeholder=""
          v-model="input"
          clearable
        ></el-input>
        <el-dropdown style="width: 50px">
          <span class="el-dropdown-link">
            <i class="el-icon-arrow-down el-icon--right"></i>
          </span>
          <el-dropdown-menu slot="dropdown">
            <el-dropdown-item>黄金糕</el-dropdown-item>
            <el-dropdown-item>狮子头</el-dropdown-item>
            <el-dropdown-item>螺蛳粉</el-dropdown-item>
            <el-dropdown-item disabled>双皮奶</el-dropdown-item>
            <el-dropdown-item divided>蚵仔煎</el-dropdown-item>
          </el-dropdown-menu>
        </el-dropdown>
        &nbsp;&nbsp;
      </p>
      <p style="margin-top: 20px; margin-left: 20px">
        物流单号：
        <el-input
          style="width: 200px; margin-left: 10px; margin-right: 20px"
          placeholder=""
          v-model="input"
          clearable
        ></el-input>
        &nbsp;&nbsp; 物流名称：
        <el-input
          style="width: 200px; margin-left: 10px; margin-right: 20px"
          placeholder=""
          v-model="input"
          clearable
        ></el-input>
      </p>
      <p style="margin-top: 20px; margin-left: 20px">
        运费结算：
        <el-select v-model="value" placeholder="关联线路" style="width: 100px">
          <el-option
            v-for="item in options"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          >
          </el-option> </el-select
        >&nbsp;&nbsp; 实际运费：<el-input
          style="width: 200px; margin-left: 10px; margin-right: 20px"
          placeholder="请输入重量"
          v-model="input"
          clearable
        >
        </el-input>
      </p>
      <p style="margin-top: 20px; height: 100px">
        <span style="display: inline-block; float: right">
          <el-button @click="goto('LogisticsList')">历史单据</el-button
          >&nbsp;&nbsp; <el-button>操作日志</el-button></span
        >
      </p>
    </div>

    <el-dialog top="20px" title="添加业务员" :visible.sync="dialogFormVisible">
      <el-input
        v-model="input"
        placeholder="请输入编号或名称"
        style="width: 200px; margin-left: 20px"
      ></el-input>
      <el-checkbox v-model="checked" style="margin-left: 20px"
        >显示禁用职员</el-checkbox
      >
      <el-button type="success" style="margin-left: 20px">查询</el-button>
      <el-table :data="gridData">
        <el-table-column type="selection" width="55"> </el-table-column>
        <el-table-column
          width="100"
          property="name"
          label="类别"
        ></el-table-column>
        <el-table-column
          width="100"
          property="address"
          label="编号"
        ></el-table-column>
        <el-table-column
          width="300"
          property="address"
          label="名称"
        ></el-table-column>
        <el-table-column
          width="100"
          property="address"
          label="联系人"
        ></el-table-column>
        <el-table-column
          width="100"
          property="address"
          label="手机"
        ></el-table-column>
        <el-table-column
          width="100"
          property="address"
          label="备注"
        ></el-table-column>
      </el-table>
      <div class="block">
        <span class="demonstration"></span>
        <el-pagination layout="prev, pager, next" :total="1000">
        </el-pagination>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible = false">取 消</el-button>
        <el-button type="primary" @click="dialogFormVisible = false"
          >确 定</el-button
        >
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: "Logistics",
  data() {
    return {
      input: "",
      value2: "",
      value3: "",
      dialogFormVisible: false,
      gridData: [
        {
          date: "2016-05-02",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          date: "2016-05-04",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          date: "2016-05-01",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          date: "2016-05-03",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
      ],
      tableData: [
        {
          ti: "132456",
          length: 2,
          width: 2,
          height: 2,
          tiji: 8,
          weight: 12,
          danwei: "轨道",
          type: "轨道",

          pricture: "",
          num: "100",
          ck: "默认仓库",
          text: "备注",
        },
      ],
      options: [
        {
          value: "选项1",
          label: "黄金糕",
        },
        {
          value: "选项2",
          label: "双皮奶",
        },
        {
          value: "选项3",
          label: "蚵仔煎",
        },
        {
          value: "选项4",
          label: "龙须面",
        },
        {
          value: "选项5",
          label: "北京烤鸭",
        },
      ],
    };
  },
  methods: {
    indexMethod(index) {
      return index + 1; // index 从 0 开始，所以加 1 来表示从 1 开始
    },
    goto(to) {
      this.$router.push(to);
    },
  },
};
</script>

<style scoped>
.el-button el-button--default el-popover__reference {
  margin-right: 20px;
}

tr {
  border: 1px solid black;
}
</style>